$OpenBSD: patch-admin_ltmain_sh,v 1.1 2004/02/01 14:55:03 espie Exp $
--- admin/ltmain.sh.orig	2003-09-24 10:44:01.000000000 +0200
+++ admin/ltmain.sh	2004-01-20 18:19:24.000000000 +0100
@@ -1294,6 +1294,17 @@ EOF
 	continue
 	;;
 
+      -pthread)
+        case $host in
+        *-*-openbsd*)
+          deplibs="$deplibs $arg"
+          ;;
+        *)
+          continue
+          ;;
+        esac
+        ;;
+
       -module)
 	module=yes
 	continue
@@ -1973,6 +1984,20 @@ EOF
 	  fi
 	  continue
 	  ;;
+        -pthread)
+          case $linkmode in
+          lib)
+            deplibs="$deplib $deplibs"
+            newdependency_libs="$deplib $newdependency_libs"
+            ;;
+          prog)
+            compile_deplibs="$deplib $compile_deplibs"
+            finalize_deplibs="$deplib $finalize_deplibs"
+            ;;
+          esac
+          continue
+          ;;
+
 	%DEPLIBS%)
 	  alldeplibs=yes
 	  continue
@@ -2785,7 +2810,7 @@ EOF
 	  # Add the "lib" prefix for modules if required
 	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
 	  eval shared_ext=\"$shrext\"
-	  eval libname=\"$libname_spec\"
+	  eval libname=\"$modname_spec\"
 	else
 	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
 	fi
